
import 'dart:async';

import 'package:flutter/services.dart';

class FlutterPluginBaidu {
  static const MethodChannel _channel =
      const MethodChannel('flutter_plugin_baidu');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  //语音播报
  static Future<String> speech(String str) async {
    final String version = await _channel.invokeMethod('speech', {"speechKey" : str});
    return version;
  }

  // 开始录音
  static Future<String> start({Map params}) async {
    return await _channel.invokeMethod('start', params ??{});
  }
  // 停止录音
  static Future<String> stop() async {
    return await _channel.invokeMethod('stop');
  }
  // 取消录音
  static Future<String> cancel() async {
    return await _channel.invokeMethod('cancel');
  }


}
